﻿
using KingerRobot.MexicoSailunMDC.Dao;

namespace KingerRobot.MexicoSailunWMS.Spi;

public interface IBuildingManageService
{
    /// <summary>
    /// 获取所有成型机
    /// </summary>
    /// <returns></returns>
    List<BuildingBean> GetAllEquipBuildings();

    /// <summary>
    /// 修改成型机宕机状态
    /// </summary>
    /// <param name="param"></param>
    /// <returns></returns>
    int UpdateCrashStatus(UpdateBuildingParam param);
    /// <summary>
    /// 修改宕机状态
    /// </summary>
    /// <param name="param"></param>
    /// <returns></returns>
    int UpdateCrash(UpdateStatusParam param);


    /// <summary>
    /// 通过宕机状态获取所有成型机
    /// <param name="status">是否宕机 true false</param>
    /// </summary>
    /// <returns></returns>
    //List<BuildingBean> GetAllEquipBuildingsByStatus(bool status);


    /// <summary>
    /// 获取所有禁用的成型机物料规格列表
    /// </summary>
    /// <returns></returns>
    List<PoWmsBuildingMaterialNotInWare> GetAllBuildingMaterialNotInWare();

    /// <summary>
    /// 新增成型机禁用规格
    /// </summary>
    /// <returns></returns>
    int AddNewBuildingMaterialNotInWare(BuildingMaterialNotInWareParam param);

    int DeleteNewBuildingMaterialNotInWare(long id);

}
public class BuildingBean
{
    /// <summary>
    /// 设备id
    /// </summary>
    public long? Id { get; set; }
    /// <summary>
    /// 设备编号
    /// </summary>
    public string EquipCode { get; set; }
    /// <summary>
    /// 设备名称
    /// </summary>
    public string EquipName { get; set; }
    /// <summary>
    /// 宕机状态 1:宕机  0:可用
    /// </summary>
    public string CrashStatus { get; set; }
    /// <summary>
    /// 宕机时间
    /// </summary>
    public DateTime? CrashTime { get; set; }
    /// <summary>
    /// 设备是否启用 1启用 0未启用
    /// </summary>
    public bool EquipEnable { get; set; }
    /// <summary>
    /// 最后修改时间
    /// </summary>
    public DateTime? UpdateTime { get; set; }
    /// <summary>
    /// 线体物料id
    /// </summary>
    public long? LineMaterialId { get; set; }
    /// <summary>
    /// 线体物料名称
    /// </summary>
    public string LineMaterialName { get; set; }
    /// <summary>
    /// 线体扫描时间
    /// </summary>
    public DateTime? LineTime { get; set; }
    /// <summary>
    /// 控制宕机显示的状态
    /// </summary>
    public bool Status { get; set; }


}
public class UpdateBuildingParam
{
    /// <summary>
    /// 设备启用状态是否同步变化
    /// </summary>
    public bool SyncChange { get; set; }
}

public class UpdateStatusParam
{
    public long id { get; set; }
}

public class BuildingMaterialNotInWareParam
{
    public string MaterialCode { get; set; }
    public int CheckType { get; set; }
}

